﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.OleDb;
using qiupeng.Public;
using System.IO;

public partial class SystemManage_username_show : System.Web.UI.Page
{
    Db List = new Db();
    BindDrowDownList list = new BindDrowDownList();
    public static string fjkey;

    protected void Page_Load(object sender, EventArgs e)
    {
        if (this.Session["username"] == null)
        {
            this.Response.Write("<script language=javascript>alert('登陆超时！');window.parent.location = '../main_d.aspx'</script>");
            return;

        }

        if (!Page.IsPostBack)
        {
            BindAttribute();

            string SQL_GetList = "select * from qp_hr_username where id='" + List.GetFormatStr(Request.QueryString["id"]) + "'";
            OleDbDataReader NewReader = List.GetList(SQL_GetList);
            if (NewReader.Read())
            {
                StaffId.Text = NewReader["StaffId"].ToString();
                StaffNumer.Text = NewReader["StaffNumer"].ToString();
                XingMing.Text = NewReader["XingMing"].ToString();
                XingBie.Text = NewReader["XingBie"].ToString();
                ShenFen.Text = NewReader["ShenFen"].ToString();
                BuMenId.Text = NewReader["BuMenId"].ToString();
                BuMen.Text = NewReader["BuMen"].ToString();

                Username.Text = NewReader["username"].ToString();
                Respon.Text = NewReader["Respon"].ToString();
                ResponId.Text = NewReader["ResponId"].ToString();
                Iflogin.Text = NewReader["Iflogin"].ToString();
                Remark.Text = NewReader["Remark"].ToString();

                string SQL_GetList1 = "select zhiweileibie from qp_hr_Staff a where a.id=" + Convert.ToInt32(StaffId.Text) + "";
                OleDbDataReader NewReader1 = List.GetList(SQL_GetList1);
                if (NewReader1.Read())
                {
                    this.lblzwlb.Text = NewReader1["zhiweileibie"].ToString();

                }
                NewReader1.Close();
                
            }
            NewReader.Close();

            List.InsertLog("查看系统用户[" + Username.Text + "]", "用户信息");
        }
    }
    public void BindAttribute()
    {
        Respon.Attributes.Add("readonly", "readonly");
        //Button2.Attributes["onclick"] = "javascript:return showwait();";

    }

    protected void Button2_Click(object sender, EventArgs e)
    {
        Response.Redirect("username.aspx");
    }

}
